import service from "@/api/index.js";

const collectApi = {
    //收藏
    insert(goodsId) {
        return service.post(`/collect/${goodsId}`);
    },
    //取消收藏
    delete(id) {
        return service.delete(`/collect/${id}`);
    },
    //根据商品di和用户id查询
    selectByGoodsIdAndUserId(goodsId) {
        return service.get(`/collect/${goodsId}`);
    },
    //查询所有的收藏
    selectByUserId(pageNum, pageSize) {
        return service.get("/collect", {
            params: {
                pageNum,
                pageSize
            }
        });
    }
};

export default collectApi;